-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
*: get rid of github.com/nspcc-dev/neo-go/pkg/io dependency #89
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #89 +/- ##
==========================================
- Coverage 74.94% 73.18% -1.76%
==========================================
Files 24 24
Lines 1313 1365 +52
==========================================
+ Hits 984 999 +15
- Misses 275 298 +23
- Partials 54 68 +14 ☔ View full report in Codecov by Sentry. |
OK, need to fix linter. |
a33583f
to
15b3f97
Compare
Ready for review. |
signature [signatureSize]byte | ||
} | ||
type ( | ||
commit struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only use them in tests, what if we're to move them into _test.go
files? It'd avoid importing encoding/gob
for non-test builds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The case is that we use them not only in tests, we also use them as default payloads for dBFT. So it won't be possible to easily integrate dBFT with Geth node without these default payloads.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Single-node Geth implementation used them before custom payloads implementation was added. Who knows, maybe one day we'll integrate dBFT with some other blockchain.
w.WriteU16LE(p.validatorIndex) | ||
w.WriteVarBytes(data) | ||
// EncodeBinary implements Serializable interface. | ||
func (p Payload) EncodeBinary(w *gob.Encoder) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this structure as well, who needs it exported?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ref. #89 (comment), DBFT
needs it as a default payload implementation:
Lines 115 to 121 in 6d59675
NewConsensusPayload: defaultNewConsensusPayload, | |
NewPrepareRequest: payload.NewPrepareRequest, | |
NewPrepareResponse: payload.NewPrepareResponse, | |
NewChangeView: payload.NewChangeView, | |
NewCommit: payload.NewCommit, | |
NewRecoveryRequest: payload.NewRecoveryRequest, | |
NewRecoveryMessage: payload.NewRecoveryMessage, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do these "default implementations" make any real sense other than for tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But how about some real intermediate implementation, like we had in Geth?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The node implemented in https://github.com/bane-labs/go-ethereum/pull/28 just won't work without these defaults. Now we have all the payloads properly implemented, but I think it's useful to have some intermediate working prototype (with default payloads) while integrating dBFT into other blockchain.
Implement custom payloads serialization using gob package. A part of #2. Signed-off-by: Anna Shaleva <[email protected]>
Some issues are found in the old files by the updated linter job. Signed-off-by: Anna Shaleva <[email protected]>
Signed-off-by: Anna Shaleva <[email protected]>
15b3f97
to
32c24ca
Compare
Make method comments start with the corresponding method name. Signed-off-by: Anna Shaleva <[email protected]>
Implement custom payloads serialization using gob package. A part of #2.